<html>
<head><meta charset="utf-8"><title>tracing assembly · t-compiler/performance · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/index.html">t-compiler/performance</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html">tracing assembly</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206699842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206699842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206699842">(Aug 12 2020 at 14:17)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/75391#issuecomment-672897272">https://github.com/rust-lang/rust/pull/75391#issuecomment-672897272</a> has before/after diffs on enabling debug! calls -- that diff looks pretty bad, to be honest, lots of jumping and such. Is that expected? Should we be editing upstream tracing code perhaps (or trying to)?</p>
<p>cc <span class="user-mention" data-user-id="307286">@Eliza Weisman</span></p>



<a name="206702169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206702169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206702169">(Aug 12 2020 at 14:35)</a>:</h4>
<p>to summarize this assembly there's a bunch of formatting code behind a conditional check as to whether this should be done at all.</p>



<a name="206702214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206702214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206702214">(Aug 12 2020 at 14:35)</a>:</h4>
<p>probably most of the cost in a typical case comes from the stack setup code to be honest.</p>



<a name="206702235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206702235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206702235">(Aug 12 2020 at 14:35)</a>:</h4>
<p>yeah it's possible it's expected, but it seems like more than I would hope for</p>



<a name="206702260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206702260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206702260">(Aug 12 2020 at 14:35)</a>:</h4>
<p>(maybe we can outline the code somehow?)</p>



<a name="206702263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206702263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206702263">(Aug 12 2020 at 14:35)</a>:</h4>
<p>and maybe some effect from instruction cache being evicted more.</p>



<a name="206703310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206703310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206703310">(Aug 12 2020 at 14:44)</a>:</h4>
<p>I guess it's being forcibly inlined because it's a macro :/</p>



<a name="206703359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206703359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206703359">(Aug 12 2020 at 14:44)</a>:</h4>
<blockquote>
<p>(maybe we can outline the code somehow?)</p>
</blockquote>
<p>That would still have the stack setup to pass the arguments, right? That seems like the most expensive part</p>



<a name="206703423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206703423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206703423">(Aug 12 2020 at 14:45)</a>:</h4>
<p>(but my assembly is really bad so take my word with a grain of salt)</p>



<a name="206703906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206703906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206703906">(Aug 12 2020 at 14:49)</a>:</h4>
<p>not necessarily, the cost in preamble is all coming from spilling registers that are latter used in formatting.</p>



<a name="206703964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206703964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206703964">(Aug 12 2020 at 14:49)</a>:</h4>
<p>outlining is not strictly necessary either, but I don’t know of llvm is capable enough to push register spilling to within a conditional if its considered cold or something.</p>



<a name="206704044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206704044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206704044">(Aug 12 2020 at 14:50)</a>:</h4>
<p>I seem to recall no</p>



<a name="206704080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206704080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206704080">(Aug 12 2020 at 14:50)</a>:</h4>
<p>but at least part of the cost should be removable -- it looks like there's panicking due to an expect involved</p>



<a name="206704120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206704120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206704120">(Aug 12 2020 at 14:50)</a>:</h4>
<p>basically instead of</p>
<div class="codehilite"><pre><span></span><code>spill_registers()
if log { format and log }
actual_code()
reload_registers()
</code></pre></div>


<p>we probably want</p>
<div class="codehilite"><pre><span></span><code>if log { spill_registers(); format and log; reload_registers() }
actual_code()
</code></pre></div>



<a name="206704300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206704300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206704300">(Aug 12 2020 at 14:52)</a>:</h4>
<p>outlining can be achieved even when expanding a macro (by expanding into an insta-called closure with <code>#[inline(never)]</code>)</p>



<a name="206758048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758048">(Aug 12 2020 at 22:01)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> hi everyone</p>



<a name="206758190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758190">(Aug 12 2020 at 22:02)</a>:</h4>
<p>I didn't spend any more time looking at this today, really, though locally reproducing seemed to look even worse with a trivial debug! call, getting a bunch of panic machinery inlined</p>



<a name="206758204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758204">(Aug 12 2020 at 22:02)</a>:</h4>
<p>i think there's definitely a lot we can do upstream to simplify the macro-generated code. we could move all of the code that constructs the key-value field set into a closure that's passed into a function, instead of generating it inline in the place where the macro is expanded.</p>



<a name="206758244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758244">(Aug 12 2020 at 22:03)</a>:</h4>
<p>i thought about doing this earlier while talking to oli about this stuff</p>



<a name="206758355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758355">(Aug 12 2020 at 22:04)</a>:</h4>
<p>the reason we didn't do that earlier is that we recently _removed_ a closure from the macros, because some folks were seeing a build time hit from the <code>tracing</code> API function that the closure was passed to getting monomorphized repeatedly</p>



<a name="206758401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758401">(Aug 12 2020 at 22:04)</a>:</h4>
<p>yeah, closures have the currently annoying property of inheriting the generics from the caller's environment which forces monomorphization -- maybe we can get the same benefits by sticking most everything into a <code>fn foo() {}</code> defined locally, though</p>



<a name="206758409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758409">(Aug 12 2020 at 22:05)</a>:</h4>
<p>(this is the <code>tracing</code> issue for that: <a href="https://github.com/tokio-rs/tracing/issues/783">https://github.com/tokio-rs/tracing/issues/783</a>)</p>



<a name="206758468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758468">(Aug 12 2020 at 22:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/tracing.20assembly/near/206758401">said</a>:</p>
<blockquote>
<p>yeah, closures have the currently annoying property of inheriting the generics from the caller's environment which forces monomorphization -- maybe we can get the same benefits by sticking most everything into a <code>fn foo() {}</code> defined locally, though</p>
</blockquote>
<p>hmm., that's possible, we could definitely do that</p>



<a name="206758556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758556">(Aug 12 2020 at 22:06)</a>:</h4>
<p>we would then just need the macro to expand a function call that borrows all the arguments that go into the valueset.</p>



<a name="206758608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758608">(Aug 12 2020 at 22:07)</a>:</h4>
<p>we could stick the whole slow path (actually recording something) behind that</p>



<a name="206758644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758644">(Aug 12 2020 at 22:07)</a>:</h4>
<p>the other thing I noted is that tracing currently generates two separate statics for every call-site which <em>feels</em> like it's got to be worse than just one, since I believe that on ELF(?) we need to load the address of each static separately, there's no notion of "adjacent statics" or whatever</p>



<a name="206758648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758648">(Aug 12 2020 at 22:07)</a>:</h4>
<p>that _should_ put all the register spilling and panic setup code in a more reasonable place</p>



<a name="206758702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758702">(Aug 12 2020 at 22:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/tracing.20assembly/near/206758644">said</a>:</p>
<blockquote>
<p>the other thing I noted is that tracing currently generates two separate statics for every call-site which <em>feels</em> like it's got to be worse than just one, since I believe that on ELF(?) we need to load the address of each static separately, there's no notion of "adjacent statics" or whatever</p>
</blockquote>
<p>huh, i thought we changed that recently</p>



<a name="206758709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758709">(Aug 12 2020 at 22:08)</a>:</h4>
<p>hm I was seeing both a META and a CALLSITE static</p>



<a name="206758737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758737">(Aug 12 2020 at 22:08)</a>:</h4>
<p>yeah that seems to be the case on tracing master right now</p>



<a name="206758746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758746">(Aug 12 2020 at 22:09)</a>:</h4>
<p>oh, for the metadata. yeah. this one is a little hairier to disentangle on the tracing side.</p>



<a name="206758760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758760">(Aug 12 2020 at 22:09)</a>:</h4>
<p>there used to be _more_ statics, now they're all in a struct besides the metadata and callsite</p>



<a name="206758768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758768">(Aug 12 2020 at 22:09)</a>:</h4>
<p>that...might not be fixable until <code>tracing-core</code> 0.2</p>



<a name="206758776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758776">(Aug 12 2020 at 22:09)</a>:</h4>
<p>yeah, I also have no actual sense of how important it is :)</p>



<a name="206758778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758778">(Aug 12 2020 at 22:09)</a>:</h4>
<p>probably not very</p>



<a name="206758832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758832">(Aug 12 2020 at 22:10)</a>:</h4>
<p>it would be nice to have an issue for "maybe don't generate two statics rather than one", so i can remember to look at it when we're breaking stuff</p>



<a name="206758874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206758874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206758874">(Aug 12 2020 at 22:10)</a>:</h4>
<p>I can file that if you'd like?</p>



<a name="206759173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206759173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206759173">(Aug 12 2020 at 22:14)</a>:</h4>
<p>filed <a href="https://github.com/tokio-rs/tracing/issues/921">https://github.com/tokio-rs/tracing/issues/921</a> but feel free to close if that's the wrong place or whatever :)</p>



<a name="206759219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206759219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206759219">(Aug 12 2020 at 22:15)</a>:</h4>
<p>that looks good to me</p>



<a name="206759256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206759256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206759256">(Aug 12 2020 at 22:15)</a>:</h4>
<p>i hadn't thought of the tuple thing, we might be able to do that without waiting for a breaking change...</p>



<a name="206759340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206759340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206759340">(Aug 12 2020 at 22:16)</a>:</h4>
<p>thanks for all your work on this, btw --- getting tracing into the compiler has been super interesting and honestly more than a little bit humbling for me :)</p>



<a name="206759362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206759362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206759362">(Aug 12 2020 at 22:17)</a>:</h4>
<p>it seems like rustc is sensitive to a pretty different set of performance concerns than the other use cases where i've looked at tracing perf</p>



<a name="206761377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/206761377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#206761377">(Aug 12 2020 at 22:43)</a>:</h4>
<p>anyway, if either of you are interested in writing a patch to  move that stuff into a function, i would happily give pointers, otherwise i will put it on my todo list!</p>



<a name="207346977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207346977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207346977">(Aug 18 2020 at 21:53)</a>:</h4>
<p>well, i have some good news, and some less good news</p>



<a name="207347970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207347970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207347970">(Aug 18 2020 at 22:05)</a>:</h4>
<p>this is the good news: <a href="https://gist.github.com/hawkw/94793f590d2f9fcf3b96fd18c71e8f3c">https://gist.github.com/hawkw/94793f590d2f9fcf3b96fd18c71e8f3c</a></p>



<a name="207348073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207348073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207348073">(Aug 18 2020 at 22:06)</a>:</h4>
<p>(i managed to get the disassembly of an <code>event!</code> macro invocation down by about 10x instructions!)</p>



<a name="207348123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207348123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207348123">(Aug 18 2020 at 22:07)</a>:</h4>
<p>can someone move this to <a class="stream" data-stream-id="247081" href="/#narrow/stream/247081-t-compiler.2Fperformance">#t-compiler/performance</a> btw?</p>



<a name="207348130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207348130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207348130">(Aug 18 2020 at 22:07)</a>:</h4>
<p>and, could shrink it more, but i felt like it was probably better to leave a second fast path inline.</p>



<a name="207348195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207348195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207348195">(Aug 18 2020 at 22:08)</a>:</h4>
<p>the less good news is i am not sure if we can make this change before <code>tracing</code> 0.2, because AFAICT it breaks a (fairly obscure) bit of API (which is being removed in 0.2 regardless)</p>



<a name="207348270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207348270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207348270">(Aug 18 2020 at 22:09)</a>:</h4>
<p>and then there's some more good news, which is that 0.2 shouldnt be <em>too</em> far away</p>



<a name="207355313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207355313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207355313">(Aug 18 2020 at 23:34)</a>:</h4>
<p>This topic was moved here from <a class="stream-topic" data-stream-id="131828" href="/#narrow/stream/131828-t-compiler/topic/tracing.20assembly">#t-compiler &gt; tracing assembly</a> by <span class="user-mention silent" data-user-id="116107">davidtwco</span></p>



<a name="207358988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207358988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207358988">(Aug 19 2020 at 00:33)</a>:</h4>
<p><span class="user-mention" data-user-id="307286">@Eliza Weisman</span> That's awesome!</p>



<a name="207480327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207480327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207480327">(Aug 20 2020 at 01:23)</a>:</h4>
<p><a href="https://github.com/tokio-rs/tracing/pull/943">https://github.com/tokio-rs/tracing/pull/943</a></p>



<a name="207480329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207480329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207480329">(Aug 20 2020 at 01:23)</a>:</h4>
<p>so that seems better</p>



<a name="207480333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207480333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207480333">(Aug 20 2020 at 01:24)</a>:</h4>
<p>(and, we can ship it now!)</p>



<a name="207908730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/tracing%20assembly/near/207908730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eliza Weisman <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/tracing.20assembly.html#207908730">(Aug 24 2020 at 23:21)</a>:</h4>
<p><a href="https://crates.io/crates/tracing/0.1.20">https://crates.io/crates/tracing/0.1.20</a> if y'all want to try it out</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>